<template>
	<view>

		<view class="pb30">
			<uni-card>
						<view class="" >
							<view class="main">
								<image :src="tiringDetail.dispatchAvatar" mode=""></image>
								<view class="">
									<view class="main-time">
										派单人
										<text>{{tiringDetail.dispatchPeople}}</text> 
									</view>
									<view class="main-time">
										派单时间
										<text>{{tiringDetail.dispatchDate}}</text> 
									</view>
								
									
								</view>
								
							</view>
							<view class="main-bottom">
								<view class="content">
									维修单号
									<text>{{tiringDetail.repairCode}}</text> 
								</view>
								<view class="content">
									上报时间
									<text>{{tiringDetail.elevatorFault.reportTime}} (人工上报)</text>
								</view>
							</view>
						</view>
					</uni-card>
					
			<uni-card>
				<textarea v-model="tiringDetail.scoreContent" placeholder="故障描述：" class="describe" maxlength="100" :disabled="true" />
				</uni-card>
		
			<uni-card>
				<view class=""  >
						<image :src="tiringDetail.repairSign" mode="" class="canvasHimc" ></image>
					<view class="f24" >
						维修人  {{tiringDetail.repairPeople}}  {{tiringDetail.recordList.length > 2 ? tiringDetail.recordList[tiringDetail.recordList.length - 2].createTime : ''}}
					</view>
				</view>
			</uni-card >
				
			<uni-card >
				<view class="adminContent"  >
					<view class="flex1">
						<image :src="parme.confirmSign" mode="" class="canvasHimc"  ></image>
						<view class="f24" >
							确认人  {{tiringDetail.confirmPeople}}  {{tiringDetail.recordList.length > 2 ? tiringDetail.recordList[tiringDetail.recordList.length - 1].createTime : ''}}
						</view>
					</view>
					<view class="success">
						<image src="@/static/img/polling/succIconB.png" mode="" class="sureIcon"></image>
						<text>通过</text>
					</view>
					</view>
				</uni-card >
			
	</view>
	
		
	</view>
</template>

<script>
	import polling from "@/serve/api/polling.js";
	import {setFile} from '@/serve/api/imgSet.js'
	import {
		mapGetters
	} from "vuex"
	export default {
		data() {
			return {
				repairautograph:false,//维修签字
				Sureflag:false,//管理签字
				
				parme:{
					scoreContent:"",//故障描述
					repairSign:"",//维修人签字
					confirmSign:"",//确认人签字
				},
				repairId:"",//故障id
				tiringDetail:{
					recordList:[],
					elevatorFault:{},
				},
				ctx:'', //绘图图像
				points:[],//路径点集合 
			}
		},
		computed: {
			...mapGetters([
				'getUserInfo',
			])
		},
		// 画布
		onLoad(e) {
			this.repairId = e.repairId
			this.getGride();
		
			

		},
		methods: {
			async getGride(){
				const res = await polling.selectRepairDetail({
					repairId:this.repairId,
				})
				this.tiringDetail = res.data.data
				Object.keys(this.parme).forEach((key, value) => {
					this.parme[key] = res.data.data[key] ? res.data.data[key] : ''
				})
				uni.setNavigationBarTitle({
				　　title:this.tiringDetail.elevatorName
				})
			},
		
		}
	}
</script>

<style scoped lang="scss">
	.main{
			display: flex;
			flex-direction: row;
			justify-content: flex-start;
			align-items: center;
			border-bottom: 1rpx solid #E2E6EF;
			padding-bottom: 15rpx;
		}
		.main image{
			width: 80rpx;
			height: 80rpx;
			background: #E2E6EF;
			border: 4rpx solid #F0F3F6;
			border-radius: 50%;
			margin-right: 18rpx;
		
		}
		.main-time{
			font-size: 24rpx;
			color: #989BA6;
		}
		.main-time text{
			margin-left: 20rpx;
			color: #34363D;
		}
		/* 头像下面内容 */
		.main-bottom{
			margin-top: 15rpx;
		}
		.content{
			display: flex;
			flex-direction: row;
			justify-content: flex-start;
			align-items: center;
			font-size: 30rpx;
			font-weight: 400;
			color: #989BA6;
			
		}
		.content text{
			margin-left: 15rpx;
			font-size: 24rpx;
			font-weight: 400;
			color: #34363D;
		}
	.somgImg{
		width: 136rpx;
		height: 136rpx;
		position: absolute;
		bottom: 30rpx;
		left: 50%;
		transform: translateX(-50%);
	}
	.backIcon{
		width: 20px;
		height: 20px;
		position: fixed;
		top: 100rpx;
		left: 30rpx;
	}
	.describe{
		width: 100%;
		height: 226rpx;
		font-size: 24rpx;
	}
	.tipText{
		padding: 5px 43rpx;
		color: #989BA6;
		text-align: right;
		font-size: 24rpx;
		text{
			font-size: 30rpx;
			font-weight: bold;
		}
	}
	.textleft{
		text-align: left;
		padding: 0; 
	}
	.canvasHimc{
		height: 260rpx;
		width: 100%;
	}
	
	.uni-card{
		width: 670rpx;
		/* height: 220rpx; */
		background: #FFFFFF;
		box-shadow: 0rpx 10rpx 10rpx 0rpx rgba(52, 54, 61, 0.05);
		border: none;
		border-radius: 16rpx;
		margin: 0 auto;
		margin-top: 20rpx;
	}
	/* 返回图标 */
	.back{
		position: fixed;
		top:119rpx;
		left: 40rpx;
	}

	/* 内容区域 */
	.main{
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		border-bottom: 1rpx solid #E2E6EF;
		padding-bottom: 15rpx;
	}
	.main image{
		width: 80rpx;
		height: 80rpx;
		background: #E2E6EF;
		border: 4rpx solid #F0F3F6;
		border-radius: 50%;
		margin-right: 18rpx;

	}
	.main-time{
		font-size: 24rpx;
		color: #34363D;
	}
	.main-time text{
		margin-left: 20rpx;
	}
	/* 头像下面内容 */
	.content{
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		margin-top: 20rpx;
		font-size: 30rpx;
		font-weight: 400;
		color: #34363D;
	}
	.alarm image{
		width: 24rpx;
		height: 24rpx;
		vertical-align: middle;
		margin-right: 10rpx;
	}
	.alarm text{
		font-size: 24rpx;
		color: #34363D;

	}
	.address{
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #989BA6;
	}
	.submitd{
		width: 670rpx;
		height: 104rpx;
		background: #017EFE;
		box-shadow: 0px 10px 15px 0px rgba(1, 126, 254, 0.2);
		border-radius: 52px;
		text-align: center;
		color: #FFFFFF;
		line-height: 104rpx;
		margin:  0 auto;
		font-size: 36rpx;
		margin-top: 40rpx;
	}
	
	.adminContent{
		display: flex;
		align-items: center;
		.flex1{
			flex: 1;
		}
		.success{
			width: 150rpx;
			height: 56rpx;
			font-size: 24rpx;
			background-color: #017EFE;
			display: flex;
			align-items: center;
			justify-content: center;
			box-shadow: 0px 5px 10px 0px rgba(1, 126, 254, 0.2);
			border-radius: 28px;
			color: #FFFFFF;
			.sureIcon{
				margin-right: 15rpx;
				width: 24rpx;
				height: 24rpx;
			}
		}
		
	}
	
	.pb30{
		padding-bottom: 30rpx;
	}
	
	.f24{
		font-size: 24rpx;
	}
	
</style>
